<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Term::ANSIScreen - Terminal control using ANSI escape sequences - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Term-ANSIScreen - MetaCPAN" href="https://metacpan.org/dist/Term-ANSIScreen/releases.rss" />
        <link rel="canonical" href="./Term::ANSIScreen.html" />
        <meta name="description" content="Terminal control using ANSI escape sequences" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Term::ANSIScreen" />
<meta name="twitter:title"       content="Term::ANSIScreen" />
<meta name="twitter:description" content="Terminal control using ANSI escape sequences" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Term::ANSIScreen.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Term-ANSIScreen was released.">
      <span class="relatize">08 Jan 2012 18:12:39 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Term-ANSIScreen">Term-ANSIScreen</a>
  </li>
  <li>
    Module version: 1.50
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Term-ANSIScreen/source/lib/Term/ANSIScreen.pm">Source</a>
    (<a href="https://metacpan.org/dist/Term-ANSIScreen/source/lib/Term/ANSIScreen.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Term-ANSIScreen/source/lib/Term">Browse</a>
    (<a href="https://metacpan.org/dist/Term-ANSIScreen/source/lib/Term?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Term-ANSIScreen/changes">Changes</a>
    </li>
    <li>
      <a rel="noopener nofollow" class="nopopup" href="http://github.com/audreyt/Term-ANSIScreen/tree">Homepage</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Term-ANSIScreen/contribute">How to Contribute</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Term-ANSIScreen">Issues</a>
      (3)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Term-ANSIScreen+1.50" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/T/Term-ANSIScreen.html?oncpan=1&amp;distmat=1&amp;version=1.50&amp;grade=2" style="color: #090">28</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/T/Term-ANSIScreen.html?oncpan=1&amp;distmat=1&amp;version=1.50&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/T/Term-ANSIScreen.html?oncpan=1&amp;distmat=1&amp;version=1.50&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/AUDREYT/Term-ANSIScreen-1.50">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Term-ANSIScreen who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Term-ANSIScreen-1.50/index.html">64.91% Coverage </a>
    </li>
    <li>
      License: unrestricted
    </li>
    <li>
      Perl: v5.5.0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Term-ANSIScreen/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/A/AU/AUDREYT/Term-ANSIScreen-1.50.tar.gz">
      Download (<span itemprop="fileSize">31.42KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FAUDREYT%2FTerm-ANSIScreen-1.50%2Flib%2FTerm%2FANSIScreen.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Term-ANSIScreen/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Term-ANSIScreen/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Term-ANSIScreen">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Term-ANSIScreen">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Term/ANSIScreen.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="AUDREYT/Term-ANSIScreen-1.50"
>1.50
  (AUDREYT on 2012-01-08)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.42"
>1.42
  (AUTRIJUS on 2004-03-22)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.41"
>1.41
  (AUTRIJUS on 2004-02-20)</option>
<optgroup label="BackPAN">'
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.40"
>1.40
  (AUTRIJUS on 2002-10-02)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.3"
>1.3
  (AUTRIJUS on 2002-08-14)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/AUDREYT/Term-ANSIScreen-1.50/diff/' + encodeURIComponent(this.value) + '/lib/Term/ANSIScreen.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="AUDREYT/Term-ANSIScreen-1.50"
>1.50
  (AUDREYT on 2012-01-08)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.42"
>1.42
  (AUTRIJUS on 2004-03-22)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.41"
>1.41
  (AUTRIJUS on 2004-02-20)</option>
<optgroup label="BackPAN">'
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.40"
>1.40
  (AUTRIJUS on 2002-10-02)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.3"
>1.3
  (AUTRIJUS on 2002-08-14)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><i class="ttip" title="dynamic_config enabled">unknown</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Term::ANSIScreen/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Term%3A%3AANSIScreen">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Term-ANSIScreen">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/AUDREYT/Term-ANSIScreen-1.50/view/lib/Term/ANSIScreen.pm">This version</a>
    </li>
    <li>
      <a href="./Term::ANSIScreen.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/PERLANCAR"><img src="https://www.gravatar.com/avatar/c66c9e215cc2342796cd87ca82d044a8?d=identicon&amp;s=20" title="PERLANCAR" alt="PERLANCAR"></a>
<a class="display-all" href="https://metacpan.org/author/XLAT"><img src="https://www.gravatar.com/avatar/a477fe9cd31dd7f08e1962deff6ef5c5?d=identicon&amp;s=20" title="XLAT" alt="XLAT"></a>
<a class="display-all" href="https://metacpan.org/author/NGLENN"><img src="https://www.gravatar.com/avatar/d760ed3250a704f6ae9e2c9b4d73cc1f?d=identicon&amp;s=20" title="NGLENN" alt="NGLENN"></a>
<a class="display-all" href="https://metacpan.org/author/DGKONTOP"><img src="https://www.gravatar.com/avatar/1f2db1aed2ab9bee2feee0b9823c61d6?d=identicon&amp;s=20" title="DGKONTOP" alt="DGKONTOP"></a>
<a class="display-all" href="https://metacpan.org/author/KHS"><img src="https://www.gravatar.com/avatar/0e07a4f7ec395adf25cce52959fd0eff?d=identicon&amp;s=20" title="KHS" alt="KHS"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Term-ANSIScreen/plussers">7 PAUSE users</a>
</div>
<div>
    6 non-PAUSE users
</div>
</div>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/AUDREYT" class="author-name">☻ 唐鳳 ☺</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Term/ANSIScreen.pm&#39;" class="">
<option
  selected
  value="AUDREYT/Term-ANSIScreen-1.50"
>1.50
  (AUDREYT on 2012-01-08)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.42"
>1.42
  (AUTRIJUS on 2004-03-22)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.41"
>1.41
  (AUTRIJUS on 2004-02-20)</option>
<optgroup label="BackPAN">'
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.40"
>1.40
  (AUTRIJUS on 2002-10-02)</option>
<option
  
  value="AUTRIJUS/Term-ANSIScreen-1.3"
>1.3
  (AUTRIJUS on 2002-08-14)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Term-ANSIScreen">Term-ANSIScreen-1.50</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage one &#10;
          • 3 direct dependents &#10;          • 5 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Term-ANSIScreen-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Term-ANSIScreen-1.50">
    <input type="hidden" name="author" value="AUDREYT">
    <input type="hidden" name="distribution" value="Term-ANSIScreen">
    <button type="submit" class="favorite highlight"><span>13</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Term::ANSIScreen.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>13</span> ++</a>
</div>
   / <span>Term::ANSIScreen</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Term::ANSIScreen.html#NAME">NAME</a></li>
  <li><a href="./Term::ANSIScreen.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Term::ANSIScreen.html#DESCRIPTION">DESCRIPTION</a>
    <ul>
      <li><a href="./Term::ANSIScreen.html#NOTES">NOTES</a></li>
    </ul>
  </li>
  <li><a href="./Term::ANSIScreen.html#FUNCTIONS">FUNCTIONS</a>
    <ul>
      <li><a href="./Term::ANSIScreen.html#Win32::Console-emulation-mode">Win32::Console emulation mode</a></li>
      <li><a href="./Term::ANSIScreen.html#The-:color-function-set-(exported-by-default)">The :color function set (exported by default)</a></li>
      <li><a href="./Term::ANSIScreen.html#The-:constants-function-set">The :constants function set</a></li>
      <li><a href="./Term::ANSIScreen.html#The-:cursor-function-set">The :cursor function set</a></li>
      <li><a href="./Term::ANSIScreen.html#The-:screen-function-set">The :screen function set</a></li>
      <li><a href="./Term::ANSIScreen.html#The-:keyboard-function-set">The :keyboard function set</a></li>
    </ul>
  </li>
  <li><a href="./Term::ANSIScreen.html#DIAGNOSTICS">DIAGNOSTICS</a></li>
  <li><a href="./Term::ANSIScreen.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Term::ANSIScreen.html#AUTHORS">AUTHORS</a></li>
  <li><a href="./Term::ANSIScreen.html#CC0-1.0-Universal">CC0 1.0 Universal</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Term::ANSIScreen - Terminal control using ANSI escape sequences</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    # qw/:color/ is exported by default, i.e. color() &amp; colored()

    use Term::ANSIScreen qw/:color :cursor :screen :keyboard/;

    print setmode(1), setkey(&#39;a&#39;,&#39;b&#39;);
    print &quot;40x25 mode now, with &#39;a&#39; mapped to &#39;b&#39;.&quot;;
    &lt;STDIN&gt;; resetkey; setmode 3; cls;

    locate 1, 1; print &quot;@ This is (1,1)&quot;, savepos;
    print locate(24,60), &quot;@ This is (24,60)&quot;; loadpos;
    print down(2), clline, &quot;@ This is (3,15)\n&quot;;

    setscroll 1, 20;

    color &#39;black on white&#39;; clline;
    print &quot;This line is black on white.\n&quot;;
    print color &#39;reset&#39;; print &quot;This text is normal.\n&quot;;

    print colored (&quot;This text is bold blue.\n&quot;, &#39;bold blue&#39;);
    print &quot;This text is normal.\n&quot;;
    print colored [&#39;bold blue&#39;], &quot;This text is bold blue.\n&quot;;
    print &quot;This text is normal.\n&quot;;

    use Term::ANSIScreen qw/:constants/; # constants mode
    print BLUE ON GREEN . &quot;Blue on green.\n&quot;;

    $Term::ANSIScreen::AUTORESET = 1;
    print BOLD GREEN . ON_BLUE &quot;Bold green on blue.&quot;, CLEAR;
    print &quot;\nThis text is normal.\n&quot;;

    # Win32::Console emulation mode
    # this returns a Win32::Console object on a Win32 platform
    my $console = Term::ANSIScreen-&gt;new;
    $console-&gt;Cls;      # also works on non-Win32 platform</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Term::ANSIScreen is a superset of <b>Term::ANSIColor</b> (as of version 1.04 of that module). In addition to color-sequence generating subroutines exported by <code>:color</code> and <code>:constants</code>, this module also features <code>:cursor</code> for cursor positioning, <code>:screen</code> for screen control, as well as <code>:keyboard</code> for key mapping.</p>

<h2 id="NOTES">NOTES</h2>

<ul>

<li><p>All subroutines in <b>Term::ANSIScreen</b> will print its return value if called under a void context.</p>

</li>
<li><p>The cursor position, current color, screen mode and keyboard mappings affected by <b>Term::ANSIScreen</b> will last after the program terminates. You might want to reset them before the end of your program.</p>

</li>
</ul>

<h1 id="FUNCTIONS">FUNCTIONS</h1>

<h2 id="Win32::Console-emulation-mode"><a id="Win32"></a><b>Win32::Console</b> emulation mode</h2>

<p>When used in a object-oriented fashion, <b>Term::ANSIScreen</b> acts as a <b>Win32::Console</b> clone:</p>

<pre><code>    use Term::ANSIScreen;
    my $console = Term::ANSIScreen-&gt;new;
    $console-&gt;Cls();            # unbuffered
    $console-&gt;Cursor(0, 0);     # same as locate(1, 1)
    $console-&gt;Display();        # really a no-op</code></pre>

<p>On the Win32 platform, the <code>new</code> constructor simply returns a geniune <b>Win32::Console</b> object, if that module exists in the system.</p>

<p>This feature is intended for people who has to port Win32 console applications to other platforms, or to write cross-platform application that needs terminal controls.</p>

<h2 id="The-:color-function-set-(exported-by-default)"><a id="The"></a><a id="The-:color-function-set--exported-by-default"></a>The <code>:color</code> function set (exported by default)</h2>

<p><b>Term::ANSIScreen</b> recognizes (case-insensitively) following color attributes: clear, reset, bold, underline, underscore, blink, reverse, concealed, black, red, green, blue, white, yellow, magenta, cyan, on_black, on_red, on_green, on_blue, on_white, on_yellow, on_magenta, and on_cyan.</p>

<p>The color alone sets the foreground color, and on_color sets the background color. You may also use on_color without the underscore, e.g. &quot;black on white&quot;.</p>

<dl>

<dt id="color-LIST"><a id="color"></a>color LIST</dt>
<dd>

<p>Takes any number of strings as arguments and considers them to be space-separated lists of attributes. It then forms and returns the escape sequence to set those attributes.</p>

</dd>
<dt id="colored-EXPR,-LIST"><a id="colored"></a><a id="colored-EXPR--LIST"></a>colored EXPR, LIST</dt>
<dd>

<p>Takes a scalar as the first argument and any number of attribute strings as the second argument, then returns the scalar wrapped in escape codes so that the attributes will be set as requested before the string and reset to normal after the string.</p>

<p>Alternately, you can pass a reference to an array as the first argument, and then the contents of that array will be taken as attributes and color codes and the remainder of the arguments as text to colorize.</p>

<p>Normally, this function just puts attribute codes at the beginning and end of the string, but if you set $Term::ANSIScreen::EACHLINE to some string, that string will be considered the line delimiter and the attribute will be set at the beginning of each line of the passed string and reset at the end of each line. This is often desirable if the output is being sent to a program like a pager, which can be confused by attributes that span lines.</p>

<p>Normally you&#39;ll want to set <code>$Term::ANSIScreen::EACHLINE</code> to <code>&quot;\n&quot;</code> to use this feature.</p>

</dd>
</dl>

<h2 id="The-:constants-function-set"><a id="The1"></a>The <code>:constants</code> function set</h2>

<p>If you import <code>:constants</code> you can use the constants CLEAR, RESET, BOLD, UNDERLINE, UNDERSCORE, BLINK, REVERSE, CONCEALED, BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, ON_BLACK, ON_RED, ON_GREEN, ON_YELLOW, ON_BLUE, ON_MAGENTA, ON_CYAN, and ON_WHITE directly. These are the same as color(&#39;attribute&#39;) and can be used if you prefer typing:</p>

<pre><code>    print BOLD BLUE ON_WHITE &quot;Text\n&quot;, RESET;
    print BOLD BLUE ON WHITE &quot;Text\n&quot;, RESET; # _ is optional</code></pre>

<p>to print colored (&quot;Text\n&quot;, &#39;bold blue on_white&#39;);</p>

<p>When using the constants, if you don&#39;t want to have to remember to add the <code>, RESET</code> at the end of each print line, you can set <code>$Term::ANSIScreen::AUTORESET</code> to a true value. Then, the display mode will automatically be reset if there is no comma after the constant. In other words, with that variable set:</p>

<pre><code>    print BOLD BLUE &quot;Text\n&quot;;</code></pre>

<p>will reset the display mode afterwards, whereas:</p>

<pre><code>    print BOLD, BLUE, &quot;Text\n&quot;;</code></pre>

<p>will not.</p>

<h2 id="The-:cursor-function-set"><a id="The2"></a>The <code>:cursor</code> function set</h2>

<dl>

<dt id="locate-[EXPR,-EXPR]"><a id="locate"></a><a id="locate--EXPR--EXPR"></a>locate [EXPR, EXPR]</dt>
<dd>

<p>Sets the cursor position. The first argument is its row number, and the second one its column number. If omitted, the cursor will be located at (1,1).</p>

</dd>
<dt id="up-[EXPR]"><a id="up"></a><a id="up--EXPR"></a>up [EXPR]</dt>
<dd>

</dd>
<dt id="down-[EXPR]"><a id="down"></a><a id="down--EXPR"></a>down [EXPR]</dt>
<dd>

</dd>
<dt id="left-[EXPR]"><a id="left"></a><a id="left--EXPR"></a>left [EXPR]</dt>
<dd>

</dd>
<dt id="right-[EXPR]"><a id="right"></a><a id="right--EXPR"></a>right [EXPR]</dt>
<dd>

<p>Moves the cursor toward any direction for EXPR characters. If omitted, EXPR is 1.</p>

</dd>
<dt id="savepos">savepos</dt>
<dd>

</dd>
<dt id="loadpos">loadpos</dt>
<dd>

<p>Saves/restores the current cursor position.</p>

</dd>
</dl>

<h2 id="The-:screen-function-set"><a id="The3"></a>The <code>:screen</code> function set</h2>

<dl>

<dt id="cls">cls</dt>
<dd>

<p>Clears the screen with the current background color, and set cursor to (1,1).</p>

</dd>
<dt id="clline">clline</dt>
<dd>

<p>Clears the current row with the current background color, and set cursor to the 1st column.</p>

</dd>
<dt id="clup">clup</dt>
<dd>

<p>Clears everything above the cursor.</p>

</dd>
<dt id="cldown">cldown</dt>
<dd>

<p>Clears everything below the cursor.</p>

</dd>
<dt id="setmode-EXPR"><a id="setmode"></a>setmode EXPR</dt>
<dd>

<p>Sets the screen mode to EXPR. Under DOS, ANSI.SYS recognizes following values:</p>

<pre><code>     0:  40 x  25 x   2 (text)   1:  40 x  25 x 16 (text)
     2:  80 x  25 x   2 (text)   3:  80 x  25 x 16 (text)
     4: 320 x 200 x   4          5: 320 x 200 x  2
     6: 640 x 200 x   2          7: Enables line wrapping
    13: 320 x 200 x   4         14: 640 x 200 x 16
    15: 640 x 350 x   2         16: 640 x 350 x 16
    17: 640 x 480 x   2         18: 640 x 480 x 16
    19: 320 x 200 x 256</code></pre>

</dd>
<dt id="wrapon">wrapon</dt>
<dd>

</dd>
<dt id="wrapoff">wrapoff</dt>
<dd>

<p>Enables/disables the line-wraping mode.</p>

</dd>
<dt id="setscroll-EXPR,-EXPR"><a id="setscroll"></a><a id="setscroll-EXPR--EXPR"></a>setscroll EXPR, EXPR</dt>
<dd>

<p>Causes scrolling to occur only on the lines numbered between the first and second arguments, inclusive.</p>

</dd>
</dl>

<h2 id="The-:keyboard-function-set"><a id="The4"></a>The <code>:keyboard</code> function set</h2>

<dl>

<dt id="setkey-EXPR,-EXPR"><a id="setkey"></a><a id="setkey-EXPR--EXPR"></a>setkey EXPR, EXPR</dt>
<dd>

<p>Takes a scalar representing a single keystroke as the first argument (either a character or an escape sequence in the form of <code>&quot;num1;num2&quot;</code>), and maps it to a string defined by the second argument. Afterwards, when the user presses the mapped key, the string will get outputed instead.</p>

</dd>
<dt id="resetkey-[LIST]"><a id="resetkey"></a><a id="resetkey--LIST"></a>resetkey [LIST]</dt>
<dd>

<p>Resets each keys in the argument list to its original mapping. If called without an argument, resets all previously mapped keys.</p>

</dd>
</dl>

<h1 id="DIAGNOSTICS">DIAGNOSTICS</h1>

<dl>

<dt id="Invalid-attribute-name-%s"><a id="Invalid"></a><a id="Invalid-attribute-name--s"></a>Invalid attribute name %s</dt>
<dd>

<p>You passed an invalid attribute name to either color() or colored().</p>

</dd>
<dt id="Identifier-%s-used-only-once:-possible-typo"><a id="Identifier"></a><a id="Identifier--s-used-only-once:-possible-typo"></a>Identifier %s used only once: possible typo</dt>
<dd>

<p>You probably mistyped a constant color name such as:</p>

<pre><code>    print FOOBAR &quot;This text is color FOOBAR\n&quot;;</code></pre>

<p>It&#39;s probably better to always use commas after constant names in order to force the next error.</p>

</dd>
<dt id="No-comma-allowed-after-filehandle"><a id="No"></a>No comma allowed after filehandle</dt>
<dd>

<p>You probably mistyped a constant color name such as:</p>

<pre><code>    print FOOBAR, &quot;This text is color FOOBAR\n&quot;;</code></pre>

<p>Generating this fatal compile error is one of the main advantages of using the constants interface, since you&#39;ll immediately know if you mistype a color name.</p>

</dd>
<dt id="Bareword-%s-not-allowed-while-&quot;strict-subs&quot;-in-use"><a id="Bareword"></a><a id="Bareword--s-not-allowed-while--strict-subs--in-use"></a>Bareword %s not allowed while &quot;strict subs&quot; in use</dt>
<dd>

<p>You probably mistyped a constant color name such as:</p>

<pre><code>    $Foobar = FOOBAR . &quot;This line should be blue\n&quot;;</code></pre>

<p>or:</p>

<pre><code>    @Foobar = FOOBAR, &quot;This line should be blue\n&quot;;</code></pre>

<p>This will only show up under use strict (another good reason to run under use strict).</p>

</dd>
</dl>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/Term::ANSIColor">Term::ANSIColor</a>, <a href="./Win32::Console.html">Win32::Console</a></p>

<h1 id="AUTHORS">AUTHORS</h1>

<p>&#x5510;&#x9CF3; &lt;cpan@audreyt.org&gt;</p>

<h1 id="CC0-1.0-Universal"><a id="CC0"></a>CC0 1.0 Universal</h1>

<p>To the extent possible under law, &#x5510;&#x9CF3; has waived all copyright and related or neighboring rights to Term-ANSIScreen.</p>

<p>This work is published from Taiwan.</p>

<p><a href="http://creativecommons.org/publicdomain/zero/1.0">http://creativecommons.org/publicdomain/zero/1.0</a></p>

<div class="pod-errors"><p>1 POD Error</p><div class="pod-errors-detail"><p>The following errors were encountered while parsing the POD:</p><dl><dt>Around line 589:</dt><dd><p>Non-ASCII character seen before =encoding in &#39;&#x5510;&#x9CF3;&#39;. Assuming UTF-8</p></dd></dl></div></div></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Term::ANSIScreen, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Term::ANSIScreen</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Term::ANSIScreen</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Term::ANSIScreen.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
